<template>
    <div>
        <div class="ptemp" v-for="(item,index) in programdata" :key="index">
            <van-image :src="item.coverUrl" width="5rem" radius="0.5rem"/>
            <div class="content">
                <div class="title">{{ item.name }}</div>
                <div class="tips">
                    <span>{{ item.dj.nickname }}</span>
                    <van-image width="0.5rem" height="0.5rem" :src="require('@/assets/index-play.png')"/>
                    <span>{{ item.listenerCount }}</span>
                </div>
                <div class="introduce">{{ item.description }}</div>
            </div>
        </div>
    </div>
</template>
<script>

export default {
    data(){
        return{
            programdata:[]
        }
    },
    created(){
        this.getProgramData();
    },
    methods:{
        getProgramData(){
            this.$request("get","/program/recommend").then((res) => {
                console.log(res);
                this.programdata = res.programs;
            })
        }
    }
}
</script>
<style scoped>
.ptemp{
    display: flex;
    text-align: left;
    margin: 1rem;
}
.content{
    width: 15rem;
    margin-left: 1rem;
}
.title{
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.tips{
    font-size: 10px;
}
.tips span{
    margin-right: 1rem;
}
.introduce{
    font-size: 14px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 2;
    text-overflow: ellipsis;
}
</style>